package com.dearbinge.data.service.impl.position;

import com.dearbinge.data.api.position.PositionService;
import com.dearbinge.data.dao.PositionMapper;
import com.dearbinge.data.pojo.position.Position;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service(value = "positionService")
public class PositionServiceImpl implements PositionService {

    @Autowired
    private PositionMapper positionMapper;

    @Override
    public Integer update(Position position) {
        Integer dataCode = positionMapper.update(position);
        return dataCode;
    }

    @Override
    public Integer insert(Position position) {
        Integer dataCode = positionMapper.insert(position);
        return dataCode;
    }

    @Override
    public Integer delete(Integer id, String userId) {
        Integer dataCode = positionMapper.delete(id,userId);
        return dataCode;
    }

    @Override
    public Position getByUserId(String userId) {
        Position position = positionMapper.getByUserId(userId);
        return position;
    }
}
